<?php
if (!defined('WY_ROOT')) exit;


class complain extends Wechat_Controller
{
    function __construct(){
		
        parent::__construct();
    }
    function index() {
		$report_status=array("0"=>"举证期内","1"=>"投诉结束","2"=>"平台客服介入处理");
		$user=$_SESSION['user'];
		$p=$_REQUEST["p"];
		if(!$p){
			$p=1;
		}
		$page=($p-1)*10;
		$complain_list=$this->model("wechart")->fetch_all('reportresult',$page.",10",$offset,"seller_userid=".$user['id'],'order by id desc');
		foreach($complain_list as $key=>$item){
			$complain_list[$key]['report_status_name']=$report_status[$item['report_status']];
		}
		if($p>1){
			$_r['complain_list']=$complain_list;
			$_r['num']=count($complain_list);
			echo json_encode($_r);
			exit;
		}
        $this->assign('complain_list', $complain_list);
		$this->assign('title',"投诉管理");
        $this->getView('complain.php')->outPut();
    }
    
} ?>